﻿//////////////////////////////////////////////////////////////////
//
// Factory.cs
//
// Copyright (c) 2012 Dan Pike. All rights reserved
//
// Refer to license.txt for any license restrictions.
// 
using Utilities;
using System.Configuration;

namespace Entities.Archive
{
   public class Factory : Utilities.ArchiveElement
   {
      public Factory()
      {
         Properties.Add(name_);
         Properties.Add(utilization_);
         Properties.Add(count_);
      }

      ////////////////////////////////////////////////////////////////////////
      //
      [ConfigurationProperty("name")]
      public string name
      {
         get { return Global.normalizeName((string)base[name_], Global.NormalizeType.Factory); }
         set { base[name_] = Global.normalizeName(value, Global.NormalizeType.Factory); }
      }

      [ConfigurationProperty("utilization")]
      public int utilization
      {
         get { return (int)base[utilization_]; }
         set { base[utilization_] = value; }
      }

      [ConfigurationProperty("count")]
      public int count
      {
         get { return (int)base[count_]; }
         set { base[count_] = value; }
      }

      ////////////////////////////////////////////////////////////////////////
      //
      private ConfigurationProperty name_ = new ConfigurationProperty("name", typeof(string), string.Empty);
      private ConfigurationProperty utilization_ = new ConfigurationProperty("utilization", typeof(int), 100);
      private ConfigurationProperty count_ = new ConfigurationProperty("count", typeof(int), 0);
   }
}
